import axios from '@/utils/axios'

export function getOrderPage(params) {
  return axios({
    url: '/order/page',
    method: 'get',
    params
  })
}

export function getOrderPageByStudent(params) {
  return axios({
    url: '/order/pages',
    method: 'get',
    params
  })
}

export function getOrderList() {
  return axios({
    url: '/order/list',
    method: 'get'
  })
}

export function createOrder(data) {
  return axios({
    url: '/order/create',
    method: 'post',
    data
  })
}

export function createByStudent(data) {
  return axios({
    url: '/order/create/student',
    method: 'post',
    data
  })
}

export function updateOrderStudent(data) {
  return axios({
    url: '/order/update',
    method: 'post',
    data
  })
}

export function updateOrderState(params) {
  return axios({
    url: '/order/state',
    method: 'get',
    params
  })
}

export function getOrderByCode(code) {
  return axios({
    url: '/order/' + code,
    method: 'get'
  })
}

export function delByOrderCode(orderCode) {
  return axios({
    url: '/order/del_' + orderCode,
    method: 'get'
  })
}

